Skip to content

feat(session_store): can logout session after n seconds - #1194

Merged
fbacall merged 2 commits into
ElixirTeSS:masterfrom
kennethrioja:login_expires_after
Dec 16, 2025
Merged

feat(session_store): can logout session after n seconds#1194
fbacall merged 2 commits into
ElixirTeSS:masterfrom
kennethrioja:login_expires_after

Conversation

@kennethrioja

@kennethrioja kennethrioja commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Summary of changes

  • We can now setup the seconds of expire_after through TeSS::Config.login_expires_after in tess.example.yml

Motivation and context

Security reasons, backed up by https://guides.rubyonrails.org/security.html#session-expiry

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.

Comment thread test/integration/session_expiry_test.rb Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this test is needed.

Also I'm slightly worried that loading that initializer will impact the rest of the test suite somehow.

Comment thread config/initializers/session_store.rb Outdated
if Rails.env.production?
opts = { same_site: :lax, secure: true }
expiry_time = TeSS::Config.login_expires_after
opts[:expire_after] = expiry_time unless expiry_time.nil?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think change the nil check to expiry_time.blank? instead, just to be safe

@fbacall
fbacall merged commit 7075be6 into ElixirTeSS:master Dec 16, 2025
7 checks passed
@kennethrioja
kennethrioja deleted the login_expires_after branch January 7, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants